// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/goods/Goods';

// 商品管理
import shezhi from '@/views/shezhi';
import indexs from '@/views/index/index';

import user from '@/views/user/user';

import Good from '@/views/good/good';
import Order from '@/views/good/order';
import catalog from '@/views/catalog/catalog';
// 图表界面
import statistics from '@/views/charts/statistics';

// 启用路由
Vue.use(Router); 

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/',
            name: '商品管理',
            component: indexs,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/charts/statistics',
            name: '数据可视化',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }
        , {
            path: '/shezhi',
            name: '设置',
            component: shezhi,
            meta: {
                requireAuth: true
            }
        }
        , {
            path: '/user/user',
            name: '用户',
            component: user,
            meta: {
                requireAuth: true
            }
        }
        , {
            path: '/good/good',
            name: '商品',
            component: Good,
            meta: {
                requireAuth: true
            }
        }
        , {
            path: '/catalog/catalog',
            name: '目录',
            component: catalog,
            meta: {
                requireAuth: true
            }
        }
        , {
            path: '/good/order',
            name: '目录',
            component: Order,
            meta: {
                requireAuth: true
            }
        }
        ]
    }]
})